#include <type_traits>
#include <iostream>

struct MyPOD {
    int x;
    double y;
};

struct MyNonPOD {
    int x;
    double y;
    virtual void display() {}  // 虚函数
};

template<typename T>
void checkPOD() {
    if (std::is_trivial<T>::value && std::is_standard_layout<T>::value) {
        std::cout << "Type is POD." << std::endl;
    } else {
        std::cout << "Type is not POD." << std::endl;
    }
}

int main() {
    std::cout << "Checking MyPOD:" << std::endl;
    checkPOD<MyPOD>();  // 应该输出：Type is POD.

    std::cout << "Checking MyNonPOD:" << std::endl;
    checkPOD<MyNonPOD>();  // 应该输出：Type is not POD.
}